package com.baizhi.serviceplus.impl;

import com.baizhi.service.UserService;
import com.baizhi.serviceplus.UserServicePlus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class UserServicePlusImpl implements UserServicePlus {
    @Autowired
    private UserService userService;
    @Override
    public Map update(Integer status, Integer id) {
        Map map=new HashMap();
        try {
            userService.update(status,id);
            map.put("isOk",true);
        } catch (Exception e) {
            e.printStackTrace();
            map.put("isOk",false);
        }
        return  map;
    }

    @Override
    public Map deleteUser(Integer id) {
        Map map=new HashMap();
        try {
            userService.deleteUser(id);
            map.put("isOk",true);
        } catch (Exception e) {
            e.printStackTrace();
            map.put("isOk",false);
        }
        return  map;
    }
}
